***********************************************************************************************
***
***	INTERTEMPORAL EVIDENCE ON THE STRATEGY OF POPULISM IN THE US (Gennaro, Lecce, Morelli)
***	Replication Package
***  
*** Appendix - Table A12
***
***********************************************************************************************



clear
est clear 

* Indicate location of the replication package here
cd "/Replication Package"


use "3_data/for_analysis/presidential_election_complete.dta", clear

egen mch_s = std(mch)
egen pop_dim2_s = std(pop_dim2)

drop if mch_s==.

eststo m1: reg pop_dim2_s trump length i.mcode, cl(statecode)
eststo m2: reg pop_dim2_s i.trump##c.mch_s length i.mcode, cl(statecode)
eststo m3: reg pop_dim2_s i.trump##c.mch_s##i.swing length i.mcode, cl(statecode)

eststo m4: reg pop_dim2_s c.mch_s##i.swing length i.mcode if trump==1, cl(statecode)
eststo m5: reg pop_dim2_s c.mch_s##i.swing length i.mcode if trump==0, cl(statecode)

eststo m6: reg pop_dim2_s i.trump##c.mch_s##i.swing i.mcode length i.statecode, cl(statecode)
eststo m7: reg pop_dim2_s i.trump##c.mch_s##i.swing i.mcode length i.statecode eduatt ancestry native , cl(statecode)

eststo m8: reg pop_dim2_s i.trump##c.mch_s##i.swing i.mcode length i.statecode eduatt ancestry native if commonstates==1, cl(statecode)



esttab m1 m2 m3 m4 m5 m6 m7 m8 using "4_results/tables/tabA12.tex", f label replace booktabs alignment(D{.}{.}{-1}) ///
s(N r2, fmt(0 2) label("Observations" "R-squared")) ///
nomtitles star(* 0.10 ** 0.05 *** 0.01) r2 b(3) se(3) brac nonotes
